package winter_vacation_homework.day_08;

/**
 * 字符串逆置，如 "I am a student" 逆置为 "student a am I" 。
 */
//StringBuffer与StringBuilder改变String
import java.util.Arrays;
import java.util.Scanner;

public class Question1 {
    public static String reverseSentence(String str) {
        String[] strings = str.split(" ");
        StringBuffer string1 = new StringBuffer();
        for (int i = strings.length - 1; i >= 0; i--) {
            string1.append(strings[i]);
            string1.append(" ");
        }
        return string1.toString();
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String string2 = scanner.nextLine();
        System.out.println(reverseSentence(string2));
    }

}
